﻿using PoemGame.ComputerAnswer.Shared;
using System.Data;

namespace PoemGame.ComputerAnswer.Db
{
    public class ComputerAnswerFactory : IComputerAnswerFactory
    {
        private readonly IDbConnection conn;
        public ComputerAnswerFactory(IDbConnection _conn)
        {
            conn = _conn;
        }
        public IComputerAnswer Create(string gametype)
        {
            switch (gametype)
            {
                case "Duishi":
                    return new ComputerAnswerDuishi(conn);
                case "Jielong":
                    return new ComputerAnswerJielong(conn);
                default:
                case "Feihualing":
                    return new ComputerAnswerFeihualing(conn);

            };
        }
    }
}